-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reset repo feature #211
Reset repo feature #211
Conversation
Still to do: actually downloading the zip file. Also, figuring out where on the project page to place the reset button; I just arbitrarily put it above the Mercurial history, but I think we want a red "Danger" area with buttons like this. |
Also to do: need to verify whether the .zip file produced by .NET Core will handle UTF-8 filenames correctly, because audio files in FLEx projects will often have names in the target language (which will often be a non-Roman script). If the functions built into .NET Core can't handle UTF-8 filenames correctly, we'll have to use 7zip (found in the |
Looks like the We used 7zip in Language Forge because at the time, Windows 7 was the most recent version of Windows and it still had a bug handling non-Roman filenames in zip files. But that bug has been fixed in Windows 10, and as long as we're using recent versions of .NET, there's no problem using the built-in zip file handlers on Unicode filenames. |
Note that once we're using .NET 8, we'll be able to use ZipFile.CreateFromDirectory without creating a temporary file. Which will reduce some code complexity and potentially save some time. |
Yes, I think that the left side would be more intuitive, and a better design choice. |
Modal dialog in UI currently does nothing, I'll hook it up next
2881b4c
to
647e126
Compare
frontend/src/routes/(authenticated)/project/[project_code]/+page.svelte
Outdated
Show resolved
Hide resolved
frontend/src/routes/(authenticated)/project/[project_code]/+page.svelte
Outdated
Show resolved
Hide resolved
frontend/src/routes/(authenticated)/project/[project_code]/+page.svelte
Outdated
Show resolved
Hide resolved
We've agreed that we'll initially backup deleted (also repos that have been deleted as part of reseting them) into a "fake repo" called "deleted". Repos that are explicitly deleted are suffixed with the deletion timestamp i.e. The |
@rmunn yeah, it appears to me that the vast majority of forms with a checkbox have the checkbox on the left with the text immediately to the right of it (rather than the text being justified to the far right of the form). I think that would be an improvement for our |
Checkbox now looks correct, and label has enough spacing
It will now actually reset the project.
Now that we're using the accent color, it clashes in both color and look. The button's distinct color is enough.
Fixes merge conflicts
Now that the code is wrapped in {#if project}, we don't need to write `project?.code` because we know it's defined at that point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks great Robin, thanks.
There's some minor changes I'd like to the API used to reset the project. I'd also like to see us use the FormModal and then have the user type in reset
before we actually let the run the reset. Could also verify they clicked the download link too actually.
frontend/src/routes/(authenticated)/project/[project_code]/+page.svelte
Outdated
Show resolved
Hide resolved
frontend/src/routes/(authenticated)/project/[project_code]/+page.svelte
Outdated
Show resolved
Hide resolved
frontend/src/routes/(authenticated)/project/[project_code]/ResetProjectModal.svelte
Outdated
Show resolved
Hide resolved
frontend/src/routes/(authenticated)/project/[project_code]/ResetProjectModal.svelte
Outdated
Show resolved
Hide resolved
frontend/src/routes/(authenticated)/project/[project_code]/ResetProjectModal.svelte
Outdated
Show resolved
Hide resolved
frontend/src/routes/(authenticated)/project/[project_code]/+page.svelte
Outdated
Show resolved
Hide resolved
We'll use an object, not a string, as the return value, to make it easier to add other fields later if desired.
Now that we're reusing the SoftDelete method, which doesn't return anything, there's no backupPath to return. It was never all that meaningful to the end user anyway, so just get rid of it and simply return an empty HTTP 200 to indicate success.
Also move the business logic inside the modal, rather than in the page, similarly to how AddProjectMember and ChangeMemberRole work.
If the repo directory cannot be found, HgService.BackupRepo will return null for the backup file path, which will turn into a 404 in the ProjectController. We'll want to detect that 404 in the UI when the user clicks on the "Backup Project" button and disallow submitting the form if that happens.
Merge conflicts resolved (by merging develop into the branch), all review discussions (so far) resolved as well. Time for a re-review in case the merge did something weird, then this will finally be ready to merge! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lots of nit picks 😉
frontend/src/routes/(authenticated)/project/[project_code]/ResetProjectModal.svelte
Outdated
Show resolved
Hide resolved
frontend/src/routes/(authenticated)/project/[project_code]/+page.svelte
Outdated
Show resolved
Hide resolved
frontend/src/routes/(authenticated)/project/[project_code]/ResetProjectModal.svelte
Outdated
Show resolved
Hide resolved
frontend/src/routes/(authenticated)/project/[project_code]/ResetProjectModal.svelte
Show resolved
Hide resolved
frontend/src/routes/(authenticated)/project/[project_code]/ResetProjectModal.svelte
Outdated
Show resolved
Hide resolved
frontend/src/routes/(authenticated)/project/[project_code]/ResetProjectModal.svelte
Outdated
Show resolved
Hide resolved
588f109
to
320c22e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rmunn looks good! 👍🏽
I implemented and pushed all my feedback.
You should probably look it over.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. I created #275 to track some features that we decided not to implement yet.
WIP on reset repo feature. Currently have UI and backend, but UI not yet hooked up to backend.
related to #155